package mvc.elicoide;

import mvc.model.ModelCurve;

import org.geom.curve.helix.Elicoide;

public class ModelElicoide extends ModelCurve implements IModelElicoide{
	
	public ModelElicoide(Elicoide curve) {
		super(curve);
	}
	
	//---------------------------------------------------------------------- observer
	/* (non-Javadoc)
	 * @see mvc.elicoide.IModelElicoide#setR(float)
	 */
	public void setR(float n) {
		// called from controller
		((Elicoide)curve).r += n;
		notifyAllViews();
	}
	
	public void setR(float n, boolean increment) {
		// called from controller
		if(increment)setR(n);
		else{
			//System.out.println("ModelElicoide mysetR : "+n);
			((Elicoide)curve).r = n;
			notifyAllViews();
		}
	}
	
	/* (non-Javadoc)
	 * @see mvc.elicoide.IModelElicoide#setK(float)
	 */
	public void setK(float n) {
		// called from controller
		((Elicoide)curve).k += n;
		notifyAllViews();
	}	
	
	public void setK(float n, boolean increment) {
		// called from controller
		if(increment) setK(n);
		else {
			((Elicoide)curve).k = n;
			notifyAllViews();
		}
	}	
	
	
	/* (non-Javadoc)
	 * @see mvc.elicoide.IModelElicoide#getR()
	 */
	public float getR() {
		return ((Elicoide)curve).r;
	}
	/* (non-Javadoc)
	 * @see mvc.elicoide.IModelElicoide#getK()
	 */
	public float getK() {
		return ((Elicoide)curve).k;
	}

	@Override
	public void setCurrentPoint(float t) {
		// TODO Auto-generated method stub
		System.out.println("ModelElicoide > set curent Point");
		super.setCurrentPoint(t);
	}

	
	
}
